package com.rs.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 点位类型
 *
 * @author zhouwz
 * @date 2020/9/11 9:30
 */
@AllArgsConstructor
public enum NodeType {

    /**
     * 点位类型
     */
    WORKING("working", "工作区"),
    CHARGE("charge", "充电区"),
    STANDBY("standby", "暂存区"),
    ROTATED("rotated", "旋转区"),
    STORAGE("storage", "库储位"),
    TURN_AREA("turnarea", "转弯区"),
    HIGH_SPEED("highSpeed", "高速区"),
    ERROR("error", "没有该点位类型"),
    ;

    @Getter
    private final String code;
    @Getter
    private final String msg;

    public static NodeType getNodeType(String code) {
        for (NodeType item : NodeType.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return ERROR;
    }
}
